<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="css/element-ui.css">
    <link rel="stylesheet" href="css/index.css">
    <link rel="stylesheet" href="css/common.css"/>
    <title>开展监管工作情况</title>
    <style type="text/css">
        html, body, #superwork {
            padding: 0px;
            margin: 0px;

        }

        #superwork {
            border-top: 3px solid #0D9AFF;
            background: #FFFFFF;
            box-shadow: 0px 2px 4px 0 rgba(200, 200, 200, 0.50);
            padding: 25px;
            background: url(./images/bg.png) no-repeat;
            background-size: cover;
            /*background-attachment: fixed;*/
            overflow: hidden;
        }

        .tab-title {
            font-size: 16px;
            font-weight: bold;
            border-left: 4px solid #0D9AFF;
            font-family: PingFangSC-Medium;
            padding-left: 10px;
            margin-bottom: 20px;
        }

        .el-dialog__footer {
            padding: 10px 20px 20px;
            text-align: center;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
        }

        .el-dialog__body {
            color: rgb(96, 98, 102);
            font-size: 14px;
            word-break: break-all;
            padding: 0px 20px;
        }

        #excel {
            display: none;
        }

        .el-input__inner {
            -webkit-appearance: none;
            background-color: #FFF;
            background-image: none;
            border-radius: 4px;
            border: 1px solid #DCDFE6;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            color: #606266;
            display: inline-block;
            font-size: inherit;
            height: 30px;
            line-height: 30px;
            outline: 0;
            padding: 0 15px;
            -webkit-transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
            transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
            width: 100%;
        }

        .listed .el-form-item__label {
            letter-spacing: 3px;
        }

        .el-textarea {
            width: 95%;
        }
    </style>
</head>

<body>
<div v-cloak id="superwork">
    <!--建设工程情况-->
    <div style="margin-top: 10px;border-bottom: 1px solid #C8C8C8;">
        <el-form :model="superWork" :rules="rules" ref="superWork" label-width="140px">
            <el-row>
                <el-col :span="4" class="tab-title">
                    建设工程情况
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="建设项目名称:" prop="projectName" label-width="110px">
                        <el-input v-model="superWork.projectName" placeholder=""></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="建设类别:" prop="projectCategory" label-width="110px">
                        <el-select v-model="superWork.projectCategory" placeholder="请选择">
                            <el-option label="工业民用建筑" value="1"></el-option>
                            <el-option label="基础设施" value="2"></el-option>
                            <el-option label="能源" value="3"></el-option>
                            <el-option label="水利" value="4"></el-option>
                            <el-option label="次生灾害工程" value="5"></el-option>
                            <el-option label="其他" value="6"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col span="6">
                    <el-form-item label="监管类别:" prop="superCategory" label-width="110px">
                        <el-select v-model="superWork.superCategory" placeholder="请选择">
                            <el-option label="安评工作成果监管" value="1"></el-option>
                            <el-option label="区域地震安全性评估成果监管" value="2"></el-option>
                            <el-option label="地震小区划工作成果监管" value="3"></el-option>
                            <el-option label="安评单位监管" value="4"></el-option>
                            <el-option label="审查专家监管" value="5"></el-option>
                            <el-option label="行政执法行为监管" value="6"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="监管时间:" prop="superTime" label-width="110px">
                        <el-date-picker
                                v-model="superWork.superTime"
                                type="date"
                                placeholder="选择监管时间">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="监管结果:" prop="superResult" label-width="110px">
                        <el-select v-model="superWork.superResult" placeholder="请选择监管结果">
                            <el-option label="符合要求" value="1"></el-option>
                            <el-option label="责令整改" value="2"></el-option>
                            <el-option label="处罚" value="3"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="情况说明:" prop="situation" label-width="110px" :required="remarksRequired">
                        <el-input
                                type="textarea"
                                :autosize="{ minRows: 8, maxRows: 8}"
                                placeholder="请输入情况说明内容"
                                v-model="superWork.situation">
                        </el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </div>
    <!--项目填报信息-->
    <div style="margin-top:30px;">
        <el-form :model="superWork" :rules="rules" ref="superWork" label-width="140px">
            <el-row>
                <el-col :span="4" class="tab-title">
                    项目填报信息
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    <el-form-item label="填报日期:" prop="subDate" label-width="110px">
                        <el-date-picker
                                v-model="superWork.subDate"
                                type="date"
                                placeholder="选择填报日期">
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="填报人员:" prop="subLeadership" label-width="110px">
                        <el-input v-model="superWork.subLeadership" placeholder="请输入填报人员"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="填报部门:" prop="subDepartment" label-width="110px">
                        <el-input v-model="superWork.subDepartment" placeholder="请输入填报部门"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="备注:" prop="remarks" label-width="110px">
                        <el-input
                                type="textarea"
                                :autosize="{ minRows: 8, maxRows: 8}"
                                placeholder=""
                                v-model="superWork.remarks">
                        </el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <!--审核信息-->
            <el-row>
                <el-col :span="4" class="tab-title">
                    审核信息
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="6">
                    <el-form-item label="审核人员:" prop="auditor" label-width="110px">
                        <el-input v-model="superWork.auditor" placeholder=""></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="审核人员机构:" prop="auditorOrgan">
                        <el-input v-model="superWork.auditorOrgan" placeholder=""></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="审核结果:" prop="examineResults" label-width="110px">
                        <el-select v-model="superWork.examineResults" placeholder="请选择">
                            <el-option label="同意" value="1"></el-option>
                            <el-option label="不同意" value="2"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="23">
                    <el-form-item label="审核意见:" prop="examineOption" label-width="110px">
                        <el-input
                                type="textarea"
                                :autosize="{ minRows: 8, maxRows: 8}"
                                placeholder="请输入内容"
                                v-model="superWork.examineOption">
                        </el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="22">
                    <div style="float:right;">
                        <el-button type="primary" size="small" style="width: 60px;height: 30px;" @click="onSubmit">提交
                        </el-button>
                        <el-button type="info" size="small" style="width: 60px;height: 30px;" @click="">取消</el-button>
                    </div>
                </el-col>
            </el-row>
        </el-form>
    </div>


</div>
<script src="js/vue.js"></script>
<script src="js/element-ui.min.js"></script>
<script src="js/axios.min.js"></script>
<script>
    var vm = new Vue({
        el: '#superwork',
        data() {
            return {
                currentPage: 1, //默认显示页面为1
                pagesize: 5, // 每页的数据条数
                radio2: 6,
                textarea3: '',
                registerForm: {
                    userName: "",
                    mobile: "",
                    email: "",
                    password: "",
                    password2: "",
                },
                superWork: [
                    {
                        projectName: '',
                        projectCategory: '',
                        superCategory: '',
                        superTime: '',
                        superResult: '',
                        situation: '',
                        subDate: '',
                        subLeadership: '',
                        subDepartment: '',
                        remarks: '',
                        auditor: '',
                        auditorOrgan: '',
                        examineResults: '',
                        examineOption: ''
                    }
                ],
                rules: {
                    projectName: [{
                        required: true,
                        message: '请输入建设项目名称',
                        trigger: 'blur'
                    }],
                    projectCategory: [{
                        required: true,
                        message: '请输入建设类别',
                        trigger: 'blur'
                    }],
                    superCategory: [{
                        required: true,
                        message: '请输入监管类别',
                        trigger: 'blur'
                    }],
                    superTime: [{
                        required: true,
                        message: '请输入监管时间',
                        trigger: 'blur'
                    }],
                    superResult: [{
                        required: true,
                        message: '请输入监管结果',
                        trigger: 'blur'
                    }],
                    situation: [{
                        required: false,
                        message: '请输入情况说明',
                        trigger: 'blur'
                    }],
                    subDate: [{
                        required: true,
                        message: '请输入填报日期',
                        trigger: 'blur'
                    }],
                    subLeadership: [{
                        required: true,
                        message: '请输入填报人员',
                        trigger: 'blur'
                    }],
                    subDepartment: [{
                        required: true,
                        message: '请输入填报部门',
                        trigger: 'blur'
                    }],
                    remarks: [{
                        required: true,
                        message: '请输入备注',
                        trigger: 'blur'
                    }],
                    auditor: [{
                        required: true,
                        message: '请输入审核人员',
                        trigger: 'blur'
                    }],
                    auditorOrgan: [{
                        required: true,
                        message: '请输入审核人员机构',
                        trigger: 'blur'
                    }],
                    examineResults: [{
                        required: true,
                        message: '请输入审核结果',
                        trigger: 'blur'
                    }],
                    examineOption: [{
                        required: true,
                        message: '请输入审核意见',
                        trigger: 'blur'
                    }]
                },
            }

        },
        methods: {
            onSubmit() {
                let supervisions = [];
                supervisions.push({
                    projectName: this.superWork.projectName,
                    // 工程类型
                    projectType: this.superWork.projectCategory,
                    // 监管类型
                    suType: this.superWork.superCategory,
                    suTime: this.superWork.superTime,
                    suResult: this.superWork.superResult,
                    // 情况说明
                    suExplain: this.superWork.situation,
                    suCreateTime: this.superWork.subDate,
                    suCreateUser: this.superWork.subLeadership,
                    suCreateDepartment: this.superWork.subDepartment,
                    suRemark: this.superWork.remarks,
                    checkUser: this.superWork.auditor,
                    checkOrg: this.superWork.auditorOrgan,
                    checkResult: this.superWork.examineResults,
                    checkView: this.superWork.examineOption
                });
                axios({
                    url: "/supervision/add",
                    method: "post",
                    enctype: 'multipart/form-data',
                    data: supervisions,
                    processData: false,
                    contentType: false,
                }).then(response => {
                    console.log(response);
                    if (response.data.code === 200) {
                        // 提交成功将要执行的代码
                        this.$message({
                            message: '提交成功',
                            type: 'success'
                        });
                    }
                }).catch(function (error) {
                    // console.log(error)
                    this.$message.error('网络超时, 请重新加载!')
                })
            }
        },
        computed: {
            remarksRequired() {
                return (this.superWork.superResult != 1) && (this.superWork.superResult != 0);
            }
        }
    })
</script>
</body>
</html>